package com.runmi.webchat.aftersale.web.api.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.runmi.webchat.aftersale.common.result.Result;
import com.runmi.webchat.aftersale.web.api.service.ApiRegionService;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@RestController
@RequestMapping(value = "/webchatapi/region")
public class ApiRegionController {

	  @Autowired
	  private ApiRegionService apiRegionService;
	
	  @ApiOperation(value = "根据父级id查询子区域列表", notes = "根据父级id查询子区域列表",tags={ "微信API", })
	  @RequestMapping(value = "/queryProvinceRegions")
	  @ResponseBody
	  public Result queryProvinceRegions(
	          @ApiParam(value = "上一级区域id(查询省时传0)",required = true)@RequestParam(value = "parentRegionId") Integer parentRegionId
	          ){
	          return apiRegionService.queryRegionsByParentId(parentRegionId);
	  }
}
